package com.baseweb.webadmin.core.model.mapper;

import com.baseweb.webadmin.core.model.pojo.ByUserWithdraw;
import com.baseweb.webadmin.core.model.pojo.ByUserWithdrawExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ByUserWithdrawMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    int countByExample(ByUserWithdrawExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    int deleteByExample(ByUserWithdrawExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    @Delete({
        "delete from by_user_withdraw",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    @Insert({
        "insert into by_user_withdraw (user_id, account_id, ",
        "descn, amount, create_time, ",
        "update_time, ",
        "status)",
        "values (#{userId,jdbcType=INTEGER}, #{accountId,jdbcType=INTEGER}, ",
        "#{descn,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{status,jdbcType=INTEGER})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(ByUserWithdraw record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    int insertSelective(ByUserWithdraw record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    List<ByUserWithdraw> selectByExample(ByUserWithdrawExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    @Select({
        "select",
        "id, user_id, account_id, descn, amount, create_time, update_time, status",
        "from by_user_withdraw",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ByUserWithdraw selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    int updateByExampleSelective(@Param("record") ByUserWithdraw record, @Param("example") ByUserWithdrawExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    int updateByExample(@Param("record") ByUserWithdraw record, @Param("example") ByUserWithdrawExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    int updateByPrimaryKeySelective(ByUserWithdraw record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_withdraw
     *
     * @mbggenerated Sun Mar 12 02:49:00 CST 2017
     */
    @Update({
        "update by_user_withdraw",
        "set user_id = #{userId,jdbcType=INTEGER},",
          "account_id = #{accountId,jdbcType=INTEGER},",
          "descn = #{descn,jdbcType=VARCHAR},",
          "amount = #{amount,jdbcType=DECIMAL},",
          "create_time = #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "status = #{status,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ByUserWithdraw record);
}